package cn.school.test;

import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

import org.apache.ibatis.session.SqlSession;

import cn.school.dao.StudentDao;
import cn.school.util.MyBatisUtil;
import cn.shcool.entity.Student;

public class StudentTest {

	public static void main(String[] args) {
		// TODO 自动生成的方法存根
		Scanner in = new Scanner(System.in);
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
		SqlSession SqlSession = MyBatisUtil.get();
		StudentDao mapper = SqlSession.getMapper(StudentDao.class);
		// Student S = mapper.getStuno(1);
		// System.out.println(S);
		// MyBatisUtil.close(SqlSession);

		// System.out.println("请输入姓名，年级编号(需要进行关联),生日,性别,qq,微信,年级号,入学日期,生源地,住址,密码");

		// String sname = in.next();
		// int gradeid = in.nextInt();
		// Date birthday = Date.valueOf(in.next());
		// String sex = in.next();
		// String qq = in.next();
		// String wechat = in.next();
		// String gname = in.next();
		// Date enterDate = Date.valueOf(in.next());
		// String fromcity = in.next();
		// String address = in.next();
		// String pass = in.next();
		// Student s = new Student();
		// s.setSname(sname);
		// s.setGradeid(gradeid);
		// s.setBirthday(birthday);
		// s.setSex(sex);
		// s.setQq(qq);
		// s.setWechat(wechat);
		// s.setGname(gname);
		// s.setEnterdate(enterDate);
		// s.setFromcity(fromcity);
		// s.setAddress(address);
		// s.setPass(pass);
		// int add = mapper.add(s);
		// System.out.println(add);

		// System.out.println("请输入学号");
		// Long stuno = in.nextLong();
		// Student s = new Student();
		// s.setStuno(stuno);
		// int del = mapper.del(1);
		// System.out.println(del);

		// List<Student> list = mapper.findall();
		// for (Student st : list) {
		// System.out.println(st);
		// }
		//
		// System.out.println("请输入姓");
		// Map<String, Object> prames = new HashMap();
		// prames.put("sname", "李");
		// prames.put("qq", "13");
		// prames.put("wechat", "14");
		// Student stu = new Student();
		// stu.setSname("sname");
		// stu.setQq("qq");
		// stu.setWechat("wechat");
		// List<Student> list = mapper.search(prames);
		// for (Student sss : list) {
		// System.out.println(sss);
		// }
		SqlSession.commit();
		SqlSession.close();
	}
}